import Vue from 'vue'
import VueRouter from 'vue-router'

// 导入login页面
import Login from '../components/Login.vue'

// 导入Home页面
import Home from '../components/Home.vue'

// 导入Welcome页面 
import Welcome from '../components/Welcome.vue'

// 导入Users页面
import Users from '../components/user/Users.vue'

Vue.use(VueRouter)

const routes = [
    { path: '/', redirect: '/home' },
    { path: '/login', component: Login },
    {
        path: '/home',
        component: Home,
        redirect: '/welcome',
        children: [
            { path: '/welcome', component: Welcome },
            { path: '/users', component: Users }
        ]
    }
]

const router = new VueRouter({
    routes
})

export default router